function get(url, data) {
    return request(url, 'get', data)
}

function post(url, data, contentType = 'x-www-form-urlencoded') {
    return request(url, 'post', data, contentType)
}

function request(url, method, data, contentType) {
    return uni.request({
        url: '/api' + url, //仅为示例，并非真实接口地址。
        data,
        method,
        header: {
            'content-type': `application/${contentType}`
        },
    });
}

export default {
    get,
    post
}
